import { get, post, postWithLoadTip, postSync } from '@/utils/request';

export function list(): any {
  return post(`/pxks-api/train/archive/list`, undefined);
}

export function page(data: any): any {
  return post(`/pxks-api/train/page`, data);
}

export function select(id: any): any {
  return post(`/pxks-api/train/select/${id}`, undefined);
}

export function start(id: any): any {
  return postSync(`/pxks-api/train/start/${id}`, undefined);
}

export function info(id: any): any {
  return post(`/pxksgl-api/train/course/detailForUser/${id}`, undefined);
}

export function userExport(data: any): any {
  return postWithLoadTip(`/pxksgl-api/train/course/detailForUser/export`, data);
}

export function userPage(data: any): any {
  return postWithLoadTip(`/pxksgl-api/train/course/detailForUser/page`, data);
}

export function userCourseWarePage(data: any): any {
  return postWithLoadTip(
    `/pxksgl-api/train/course/detailForUser/course/ware/page`,
    data
  );
}

//培训图表数据
export function getChartData(data: any): any {
  return get(`/pxksgl-api/train/course/bar?trainId=${data}`, undefined);
}
